print('今天是周二')

name_list = ['zhangsan', 'lishi']
print(name_list)

neme_age = ('zhangsan', 18)
print(neme_age)

person = {'name': 'zhangsan', 'age': 18}
print(person)

print(type(person))
print(type(name_list))

a = '123'
print(type(a))

print(type(int(a)))

b = '12'
print(float(b))

c = 34
print(type(c))
print(type(str(34)))

d = 'abc'

print(bool(d))

e = ''
print(bool(e))

# 什么情况下是False
print(bool(0))
print(bool(0.0))
print(bool(''))
print((bool("")))
print(bool([]))
print(bool(()))
print(bool({}))

food_list = ['abc', 'def', 'ghi']

food = input('输入字母')

if food in food_list:
    print("在")
else:
    print("不在")

ball_list = ['篮球', '乒乓球']

ball = input('请输入球类')

if ball not in ball_list:
    print('不在')
else:
    print('在')

person = {"name": 'zhangsan', 'age': 12}

print(person.get('sex'))

person['age'] = 13

person['sex'] = '男'

print(person)

del person['name']

print(person)

person.clear()

print(person)


def sum2(a, b):
    return a + b


c = sum2(30, 23)

print(c)


fp = open('测试文件/a.txt','w')
fp.write('hell word')
fp.close()



fp1 = open('测试文件/a.txt','r')
content = fp1.read()
fp1.readline()
fp1.readlines()
print(content)
